package com.common.utils.http;

/**
 * http请求参数封装
 * 
 * @author feijinbo
 * 
 */
@SuppressWarnings("rawtypes")
public class Parameter implements java.io.Serializable, Comparable {

	private static final long serialVersionUID = 5164951358145483848L;

	public String mName;

	public String mValue;

	public Parameter(String name, String value) {
		this.mName = name;
		this.mValue = value;
	}

	@Override
	public boolean equals(Object arg0) {
		if (null == arg0) {
			return false;
		}
		if (this == arg0) {
			return true;
		}
		if (arg0 instanceof Parameter) {
			Parameter param = (Parameter) arg0;
			return this.mName.equals(param.mName)
					&& this.mValue.equals(param.mValue);
		}
		return false;
	}

	public int compareTo(Object o) {
		int compared;
		Parameter param = (Parameter) o;
		compared = mName.compareTo(param.mName);
		if (0 == compared) {
			compared = mValue.compareTo(param.mValue);
		}
		return compared;
	}

	public String getmName() {
		return mName;
	}

	public void setmName(String mName) {
		this.mName = mName;
	}

	public String getmValue() {
		return mValue;
	}

	public void setmValue(String mValue) {
		this.mValue = mValue;
	}
	
}
